package ${package}.${moduleName}.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import net.maku.framework.common.utils.PageResult;
import net.maku.framework.common.utils.Result;
import ${package}.newBase.NewBaseController;
import ${package}.newbase.NewQuery;
import ${package}.newbase.PageParam;

import ${package}.${moduleName}.convert.${ClassName}Convert;
import ${package}.${moduleName}.vo.${ClassName}VO;
import ${package}.${moduleName}.entity.${ClassName}Entity;
import ${package}.${moduleName}.service.${ClassName}Service;
import org.springframework.web.bind.annotation.*;

/**
* ${tableComment}
*
* @author ${author} ${email}
*/
@RestController
@RequestMapping("${moduleName}/${functionName}")
@Tag(name="${tableComment}")
@AllArgsConstructor
public class ${ClassName}Controller extends NewBaseController<${ClassName}Service, ${ClassName}Entity>{

    @GetMapping("page")
    @Operation(summary = "分页")
    public Result<PageResult<${ClassName}VO>> page(PageParam page, NewQuery query){
        LambdaQueryWrapper<${ClassName}Entity> select = new LambdaQueryWrapper<>();

        IPage<${ClassName}Entity> iPage = entityService.page(page.b(), select);
        return Result.ok(new PageResult<>(${ClassName}Convert.INSTANCE.convertList(iPage.getRecords()), iPage.getTotal()));
    }

}